import request from '@/utils/request'

export default {


    // 得到所有老师
    getAllTeacher() {

        return request({
            url: `/eduservice/edu-teacher/getAllTeacher`,
            method: "get",
        })
    },

    // 添加一节课
    addCourseInfo(courseInfo) {

        return request({
            url: `/eduservice/edu-course/addCourse`,
            method: "post",
            data: courseInfo
        })

    },

    //根据Id查询
    getCourseById(id) {

        return request({

            url: `/eduservice/edu-course/getCourseById?id=${id}`,
            method: "get"

        })
    },

    //修改课程
    updateCourse(courseInfo) {

        return request({
            url: `/eduservice/edu-course/updateCourse`,
            method: "post",
            data: courseInfo,
            withCredentials: false
        })

    },

    //根据课程id得到课程发布信息
    getPulishInfoById(courseId) {

        return request({

            url: `/eduservice/edu-course/getPulishInfoById?id=${courseId}`,
            method: "get"

        })


    },

    //修改课程发布状态
    publishCourse(courseId) {

        return request({

            url: `/eduservice/edu-course/publishCourse?id=${courseId}`,
            method: "get"
        })
    },


    //查询课程分页
    getCoursePage(pageQuery) {


        return request({

            url: `/eduservice/edu-course/getCoursePage`,
            method: "post",
            data: pageQuery

        })
    },


    //删除课程
    deleteCourseById(courseId) {

        return request({

            url: `/eduservice/edu-course/deleteCourseById?id=${courseId}`,
            method: "get"
        })

    }




}